// pages/lang-select/lang-select.js

const app = getApp();

Page({

    /**
     * 页面的初始数据
     */
    data: {
        curLang: {},
        langList: app.globalData.langList
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        this.setData({
            curLang: app.globalData.curLang
        })
    },

    onTapItem: function (e) {
        let langObject = e.currentTarget.dataset
        console.log(langObject)

        this.setData({
            curLang: langObject
        })

        app.globalData.curLang = langObject
        wx.switchTab({
            url: '/pages/index/index'
        })
    }

})